time: Use simulated time in tests, rather than MockTimeSystem, except in one case testing error-message throttling#4591
Merged
mattklein123 merged 7 commits intoenvoyproxy:masterfrom Oct 3, 2018
Conversation
…ces. Signed-off-by: Joshua Marantz <jmarantz@google.com>
…o stay a mock. Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Contributor
Author
|
@junr03 please note that this PR includes eac0c69 which I did before having merged in your #4581. ConnectionImplTest.FlushWriteAndDelayCloseTimerTriggerTest had to be excluded from the TimeSystem conversion. For some reason I couldn't get it to work and had to add some hackery to allow it to stick with a MockTimeSystem. The fact that I could only get it working with a MockTimeSystem made me suspicious of the code but I didn't find root-cause. If you un-revert #4581 you may need to pull in the exclusion from the commit above. As it stands it's a non-issue for this PR as you deleted the test that I was having trouble with. |
…eSystem(). That was added to allow FlushWriteAndDelayCloseTimerTriggerTest to use a MockTimeSystem. If that test is revived, we may need to bring back the virtual timeSystem() hook. Signed-off-by: Joshua Marantz <jmarantz@google.com>
mattklein123
approved these changes
Oct 3, 2018
aa-stripe
pushed a commit
to aa-stripe/envoy
that referenced
this pull request
Oct 11, 2018
… in one case testing error-message throttling (envoyproxy#4591) Signed-off-by: Joshua Marantz <jmarantz@google.com> Signed-off-by: Aaltan Ahmad <aa@stripe.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description: MockTimeSystem is harder to use as you can control time with the usual mocking mechanisms, but that won't run timers, so it doesn't reflect system behavior well, potentially missing interactions. SimulatedTimeSystem is just as easy to control for the most part, unless you want to pre-program a sequence of responses to TimeSystem::monotonicTime(), which is needed in a GRPC error-message throttling test.
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a